package com.company.cloud.product.modules.api.fallback;

import java.util.Map;
import java.util.Set;

import org.springframework.stereotype.Component;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.product.modules.api.request.ProductStockMultipleSkuOpParam;
import com.company.cloud.product.modules.api.request.ProductStockSingleSkuOpParam;
import com.company.cloud.product.modules.api.response.PrdSkuStock;
import com.company.cloud.product.modules.api.service.ProductStoctRemoteService;

import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;

@Log4j2
@Component
public class ProductStoctRemoteServiceFallbackFactory implements FallbackFactory<ProductStoctRemoteService>{@Override
	
	
	public ProductStoctRemoteService create(Throwable cause) {
		return new ProductStoctRemoteService() {

			@SuppressWarnings("unchecked")
			@Override
			public BaseClientResult<String> opSingleSkuStock(ProductStockSingleSkuOpParam params) {
				return BaseClientResult.callbackError();
			}

			@SuppressWarnings("unchecked")
			@Override
			public BaseClientResult<String> opMultipleSkuStock(ProductStockMultipleSkuOpParam params) {
				return BaseClientResult.callbackError();
			}

			@SuppressWarnings("unchecked")
			@Override
			public BaseClientResult<Map<String, PrdSkuStock>> getSkuStockList(Set<String> skuNos) {
				return BaseClientResult.callbackError();
			}

			@SuppressWarnings("unchecked")
			@Override
			public BaseClientResult<Map<String, PrdSkuStock>> getPrdStockList(Set<String> prdNos) {
				return BaseClientResult.callbackError();
			}

			@SuppressWarnings("unchecked")
			@Override
			public BaseClientResult<Map<String, PrdSkuStock>> getPrd2SkuStock(String prdNo) {
				return BaseClientResult.callbackError();
			}
			

		};
	}


}
